package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;

import javax.validation.constraints.NotNull;
import java.util.List;

import static org.jsola.hr.example.SalaryPlanFormulaExample.*;
import javax.validation.constraints.NotNull;

import static org.jsola.hr.example.SalaryPlanFormulaExample.E_COMPANY_ID;
import static org.jsola.hr.example.SalaryPlanFormulaExample.E_CONDITION_RELATION;
import static org.jsola.hr.example.SalaryPlanFormulaExample.E_FORMULA;
import static org.jsola.hr.example.SalaryPlanFormulaExample.E_SALARY_PLAN_ID;
import static org.jsola.hr.example.SalaryPlanFormulaExample.E_SORT;
import static org.jsola.hr.example.SalaryPlanFormulaExample.M_COMPANY_ID_MAX;
import static org.jsola.hr.example.SalaryPlanFormulaExample.M_COMPANY_ID_NOT_NULL;
import static org.jsola.hr.example.SalaryPlanFormulaExample.M_FORMULA_MAX;
import static org.jsola.hr.example.SalaryPlanFormulaExample.M_SALARY_PLAN_ID_MAX;
import static org.jsola.hr.example.SalaryPlanFormulaExample.N_COMPANY_ID;
import static org.jsola.hr.example.SalaryPlanFormulaExample.N_CONDITION_RELATION;
import static org.jsola.hr.example.SalaryPlanFormulaExample.N_FORMULA;
import static org.jsola.hr.example.SalaryPlanFormulaExample.N_SALARY_PLAN_ID;
import static org.jsola.hr.example.SalaryPlanFormulaExample.N_SORT;

/**
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "新增【工资方案计算公式及条件】的参数")
@Data
public class SalaryPlanFormulaAddDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_SALARY_PLAN_ID, example = E_SALARY_PLAN_ID)
    @Length(max = 32, message = M_SALARY_PLAN_ID_MAX)
    private String salaryPlanId;

    @ApiModelProperty(notes = N_FORMULA, example = E_FORMULA)
    @Length(max = 255, message = M_FORMULA_MAX)
    private String formula;

    @ApiModelProperty(notes = N_CONDITION_RELATION, example = E_CONDITION_RELATION)
    private Integer conditionRelation;

    @ApiModelProperty(notes = N_SORT, example = E_SORT)
    private Integer sort;

    @NotNull
    @ApiModelProperty(notes = N_FORMULA_CONDITION, example = E_FORMULA_CONDITION)
    private List<SalaryFormulaConditionAddDTO> salaryFormulaConditionAddDTOList;
    @ApiModelProperty(notes = N_COMPANY_ID, example = E_COMPANY_ID, required = true)
    @NotNull(message = M_COMPANY_ID_NOT_NULL)
    @Length(max = 32, message = M_COMPANY_ID_MAX)
    private String companyId;


}

